//
//  HEDoctorServerInfoCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/17.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEDoctorServerInfoCell.h"

@interface HEDoctorServerInfoCell ()

@property (nonatomic, strong) UILabel *titleLb;
@property (nonatomic, strong) UITextView *contentLb;

@end

@implementation HEDoctorServerInfoCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    self.contentView.backgroundColor = CViewBgColor;
    
    UIView *warp = [UIView new];
    [self.contentView addSubview:warp]; 

    [warp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.left.equalTo(self.contentView).mas_offset(15);
        make.right.equalTo(self.contentView).mas_offset(-15);
        make.bottom.equalTo(self.contentView).mas_offset(-0);
    }];
    
    warp.layer.masksToBounds = YES;
    warp.layer.cornerRadius = 6;
    
    warp.backgroundColor = KHexColor(@"E8F2FE");
    warp.qmui_borderPosition = QMUIViewBorderPositionBottom | QMUIViewBorderPositionTop| QMUIViewBorderPositionLeft | QMUIViewBorderPositionRight;
    warp.qmui_borderWidth = 1;
    warp.qmui_borderColor = CNavBgColor;
    
    // 姓名
    _titleLb = [UILabel new];
    _titleLb.text = @"服务内容";
    _titleLb.font = DYBlodFont(18);
    [warp addSubview:_titleLb];
    
    // 描述
    _contentLb = [UITextView new];
    _contentLb.editable=NO;
    _contentLb.scrollEnabled = NO;
    _contentLb.textColor = CNavLightBlackColor;
    _contentLb.font = DYFont(15);
    _contentLb.backgroundColor = UIColor.clearColor;
    [self.contentView addSubview:_contentLb];
    
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(warp).mas_offset(15);
        make.left.equalTo(warp.mas_left).mas_offset(10);
        make.right.equalTo(warp.mas_right).mas_offset(-10);
    }];
    
    [_contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_titleLb.mas_bottom).mas_offset(10);
        make.left.equalTo(_titleLb.mas_left);
        make.right.equalTo(_titleLb.mas_right);
        make.bottom.equalTo(warp.mas_bottom).mas_offset(-0);
    }];
}

- (void)refreshContent:(GDFiterCellModel *)fiterModel formModel:(GDFormModel *)formModel indexPath:(NSIndexPath *)indexPath {
    _contentLb.attributedText = formModel.doc_selectServer.KdetailHtml;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
